package com.common;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;

public class PageFragment extends Fragment{  

	     
        private View pageView;
	    
	    public static PageFragment newInstance(View view)
	    {
	    	PageFragment fragment=new PageFragment();
	    	fragment.pageView=view;
	    	return fragment;
	    }

	    @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
              
	    }

	    @Override
	    public View onCreateView(LayoutInflater inflater, ViewGroup container,
	    	Bundle savedInstanceState) {
             android.view.ViewGroup.LayoutParams params=new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
	    	 LinearLayout layout = new LinearLayout(getActivity());
	        layout.setLayoutParams(params);
	        layout.setGravity(Gravity.CENTER);
	        layout.addView(pageView);

	        return layout;
	    }
	   
	    @Override
	    public void onSaveInstanceState(Bundle outState) {
	        super.onSaveInstanceState(outState);
	      
	    }
	}